<template>
  <el-tabs
    v-model="activeTab"
    class="std-prescription-tabs-info"
    type="card"
  >
    <el-tab-pane
      v-for="tab in pageData.editorItems"
      :key="tab.key"
      :name="tab.key"
      :label="tab.name"
      class="h-full"
    >
      <el-form>
        <form-editor-item v-model="pageData.formData.head[tab.key]" />
      </el-form>
    </el-tab-pane>
  </el-tabs>
</template>
<script>

export default {
  name: "IkDTable",
  inject: ["pageData"],
  data() {
    return {
      activeTab: "po",
      loading: false,
      listLoading: false
    }
  },
  created() {
    this.activeTab = this.pageData.editorItems[0].key
  },
  methods: {
    /**
     * 新增行按钮
     * @param curr
     * @param index
     */
    addRow(curr, index) {
      this.pageData.formData.body[curr].splice(index + 1, 0, {})
    },
    /**
     * 删除行按钮
     * @param curr
     * @param index
     */
    delRow(curr, index) {
      this.pageData.formData.body[curr].splice(index, 1)
    }
  }
}
</script>

<style scoped lang="scss">
.std-prescription-tabs-info {
  height: 50vh;
}

.button-action {
  .option-label {
    padding: 0 12px
  }

  .option-btn {
    width: 26px;
    height: 26px;
    color: #409EFF;
    padding: 3px 0;
    margin-top: 3px
  }

  .option-large-btn {
    width: 28px;
    height: 28px;
    color: #409EFF;
    padding: 3px 0;
    margin-top: 3px
  }
}
</style>
